package android.medicalcloud.com.yiapp.yilian.ui.ac;

import android.medicalcloud.com.yiapp.R;
import android.medicalcloud.com.yiapp.base.activity.BaseActivity;
import android.medicalcloud.com.yiapp.yilian.ui.view.CommonTitleView;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 * Created by wanggenlin on 17-5-18.
 */
public class WebViewActivity extends BaseActivity {
    WebView webView;
    CommonTitleView titleView;
    @Override
    protected void initView() {

    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected void initData() {
        webView = (WebView) findViewById(R.id.webView);
        titleView = (CommonTitleView)findViewById(R.id.titleView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl(getIntent().getStringExtra("url"));
        titleView.setTitleText(getIntent().getStringExtra("title"));
                webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return super.shouldOverrideUrlLoading(view, url);
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.ac_webview;
    }
}
